// 处理用户注册逻辑

const db = require("../lib/db")

function zhuce(username,userpwd,desc){
    console.log(username,userpwd,desc)
    return new Promise((resolve,reject)=>{
        let sql = "select * from zhuce";
        console.log(sql)
        db.querySql(sql).then(data=>{
            console.log(data)
            if(data.length == 0){
                resolve(501)
            }else{
                resolve(200)
                console.log("注册成功")
            }
        })
    })
    
}

// 导出
module.exports = zhuce;
